﻿using ClinicSystem.configure;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;

namespace ClinicSystem.FormPage
{
    public partial class WndQueryInfo : Form
    {
        internal List<string> peopleinfo = new List<string>();

        public WndQueryInfo()
        {
            InitializeComponent();
            search1.ComboBoxTextChanged += Search1_ComboBoxTextChanged;


        }

        private void Search1_ComboBoxTextChanged(object sender, EventArgs e)
        {
            
            richTextBox1.Clear();
            ComboBox cmb = sender as ComboBox;
            string telnum = cmb.Text.Trim();
            label_name.Text = search1.peopleInfo[1];
            label_age.Text = search1.peopleInfo[3];
            label_symptom.Text = search1.peopleInfo[4];
            label_date.Text = search1.peopleInfo[8];
            for(int i=0;i<search1.medicineList.Count; i++)
            {
                richTextBox1.AppendText(search1.medicineList[i]+" " +
                    search1.dosageList[i] + "总计" + Convert.ToInt32(search1.number[0])* Convert.ToInt32(search1.dosageList[i] )
                    + search1.dosageList[i] + "克  ");
                if ((i + 1) % 6 == 0)
                {
                    richTextBox1.AppendText("\r\n"); // 换行
                }
            }

            
            //Load_OutFile.CmdQuery("SELECT * FROM person WHERE name=''")
        }

        private void UpdateRichTextBox()
        {

        }






    }
}
